From c790cc2cbf4ad7f3cad2b026c181748e110a8e0a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 3 Aug 2009 08:21:29 +0000 Subject: [PATCH] * net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New defconst. (tramp-rfn-eshadow-update-overlay): Use it. --- lisp/net/tramp.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e8ce36e4c07..df2f10ba5dd 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2196,6 +2196,9 @@ special handling of `substitute-in-file-name'." (remove-hook 'rfn-eshadow-setup-minibuffer-hook 'tramp-rfn-eshadow-setup-minibuffer)))) +(defconst tramp-rfn-eshadow-update-overlay-regexp + (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) + (defun tramp-rfn-eshadow-update-overlay () "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. This is intended to be used as a minibuffer `post-command-hook' for @@ -2209,7 +2212,10 @@ been set up by `rfn-eshadow-setup-minibuffer'." (save-excursion (save-restriction (narrow-to-region - (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) + (1+ (or (string-match + tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end) + end)) + (point-max)) (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) (rfn-eshadow-update-overlay-hook nil)) (move-overlay rfn-eshadow-overlay (point-max) (point-max)) -- 2.30.2